package com.joolun.system.service.impl;

import java.util.List;

import com.joolun.common.corp.TenantContext;
import com.joolun.common.utils.DateUtils;
import com.joolun.system.domain.vo.EduSchedulingVo;
import org.springframework.beans.factory.annotation.Autowired;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.stereotype.Service;
import com.joolun.system.mapper.EduSchedulingMapper;
import com.joolun.system.domain.EduScheduling;
import com.joolun.system.service.IEduSchedulingService;

/**
 * 招生排期Service业务层处理
 * 
 * @author joolun
 * @date 2025-02-27
 */
@Service
public class EduSchedulingServiceImpl extends  ServiceImpl<EduSchedulingMapper, EduScheduling> implements IEduSchedulingService
{
    @Autowired
    private EduSchedulingMapper eduSchedulingMapper;

    /**
     * 查询招生排期
     * 
     * @param schedulingId 招生排期主键
     * @return 招生排期
     */
    @Override
    public EduScheduling selectEduSchedulingBySchedulingId(Long schedulingId)
    {
        return eduSchedulingMapper.selectEduSchedulingBySchedulingId(schedulingId);
    }

    /**
     * 查询招生排期列表
     * 
     * @param eduScheduling 招生排期
     * @return 招生排期
     */
    @Override
    public List<EduSchedulingVo> selectEduSchedulingList(EduScheduling eduScheduling)
    {
        // 添加主体id
        eduScheduling.setCorpId(TenantContext.getTenantId());
        return eduSchedulingMapper.selectEduSchedulingList(eduScheduling);
    }

    /**
     * 新增招生排期
     * 
     * @param eduScheduling 招生排期
     * @return 结果
     */
    @Override
    public int insertEduScheduling(EduScheduling eduScheduling)
    {
        // 添加主体id
        eduScheduling.setCorpId(TenantContext.getTenantId());
        eduScheduling.setCreateTime(DateUtils.getNowDate());
        return eduSchedulingMapper.insertEduScheduling(eduScheduling);
    }

    /**
     * 修改招生排期
     * 
     * @param eduScheduling 招生排期
     * @return 结果
     */
    @Override
    public int updateEduScheduling(EduScheduling eduScheduling)
    {
        eduScheduling.setUpdateTime(DateUtils.getNowDate());
        return eduSchedulingMapper.updateEduScheduling(eduScheduling);
    }

    /**
     * 批量删除招生排期
     * 
     * @param schedulingIds 需要删除的招生排期主键
     * @return 结果
     */
    @Override
    public int deleteEduSchedulingBySchedulingIds(Long[] schedulingIds)
    {
        return eduSchedulingMapper.deleteEduSchedulingBySchedulingIds(schedulingIds);
    }

    /**
     * 删除招生排期信息
     * 
     * @param schedulingId 招生排期主键
     * @return 结果
     */
    @Override
    public int deleteEduSchedulingBySchedulingId(Long schedulingId)
    {
        return eduSchedulingMapper.deleteEduSchedulingBySchedulingId(schedulingId);
    }
}
